import { config } from 'dotenv'
import { resolve } from 'path'

// 加载环境变量
config({ path: resolve(process.cwd(), '.env') })

// 配置对象
export const CONFIG = {
	// Deepseek API 配置
	DEEPSEEK_API_KEY: process.env.DEEPSEEK_API_KEY || '',
	DEEPSEEK_API_MODEL: process.env.DEEPSEEK_API_MODEL || 'deepseek-chat',
	DEEPSEEK_API_BASE_URL: process.env.DEEPSEEK_API_BASE_URL || 'https://api.deepseek.com',
}

// 验证必要的环境变量
if (!CONFIG.DEEPSEEK_API_KEY) {
	throw new Error('缺少环境变量: DEEPSEEK_API_KEY')
}

if (!CONFIG.DEEPSEEK_API_MODEL) {
	throw new Error('缺少环境变量: DEEPSEEK_API_MODEL')
} 